<?php

/*

  Action	$3

  Gain a card costing up to $4.

 */

class Workshop extends Card implements iAction, iKingdom, iBasic {

    public function __construct() {
        parent::__construct("Workshop", 3);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Gain a card costing up to $4.");
    }
    
    public function play(Game $game, $isRealCard) {

        $four_or_less_cards = $game->getBoardCardsByPrice(new Price(), new Price(4));
        $output = MySocket::GetUserReply($game, Input_ChooseOne, $four_or_less_cards, 1, 1, null, "Choose a card");
        $card_name = $output[0];
        $card = $game->moveCardFromPileToPile($card_name, BoardCards, DiscardPile);
         ScreenDisplay::addScreenMessage($game, true, "gain ".  nicePrint($card), "gains ". ScreenDisplay::$LMSG);
        $game->cardActionFinished();
        return true;
    }

}

?>